1. Technical Field
The present invention relates generally to computer systems, and more specifically to techniques for making procedure calls.
2. Background Art
Programming languages provide facilities for making procedure calls, whereby code which is reusable can be placed in a defined location and executed when needed. Parameters can be passed to called procedures, and results returned. As used herein, the term procedure will be used in a generic sense; program segments which are referred to in particular instances as procedures, functions, and subroutines will all be referred to herein as procedures.
Details of procedure calling conventions differ with different programming languages. Some parameters may be passed in registers, on a procedure stack, or in memory blocks pointed to by pointers held in a register or a stack location. Because of different calling conventions used by different languages, procedure calls must be made to procedures originally written in the same language, or another language using the same calling conventions. If it is desired to make a call to a procedure originally written in a different language, and the identity of the original language is known, special steps can sometimes be taken to restructure the call to function correctly with such procedure. This restructuring usually requires modification of the call at the assembly language level.
In many computer systems, including virtually all large and medium size systems, common libraries of procedures are maintained for standard and often used functions. These procedures are called from application programs, freeing an applications programmer from writing and debugging code to perform common functions. Depending on the system design, library functions can be linked to an application program at link time, or they may be dynamically linked at execution time if this is supported by the operating system.
The language calling convention problem described above exists with the use of procedure libraries. A library procedure must typically be written in each language supported by the system, so that multiple procedures exist for performing the same library function An alternative is to have one or a limited number of procedures written in a particular language, and require applications programmers to perform whatever steps are necessary in order to call procedures written in different languages.
Requiring that a system maintain multiple procedures, written in different languages, for performing a single common function is inefficient. Forcing applications programmers to undertake steps necessary to call a procedure which uses a different calling convention is not always possible, and is clearly undesirable even where possible.
It would therefore be desirable for a system to provide the ability for applications programs to call library procedures without regard to the calling conventions used by the language the procedures were originally written in. It would also be desirable for such a system to provide the ability to change library procedures, including changing the language they are written in, without adversely affecting any applications program which might call such procedure.